<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="捆包号" prop="bundleNumber">
        <el-input
          v-model="queryParams.bundleNumber"
          placeholder="请输入捆包号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货物类型" prop="goodsType">
        <el-select v-model="queryParams.goodsType" placeholder="请选择货物类型" clearable>
          <el-option
            v-for="dict in dict.type.goods_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <!--el-form-item label="品名" prop="product">
        <el-input
          v-model="queryParams.product"
          placeholder="请输入品名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <el-form-item label="规格" prop="specification">
        <el-input
          v-model="queryParams.specification"
          placeholder="请输入规格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--el-form-item label="材质" prop="steelGrade">
        <el-input
          v-model="queryParams.steelGrade"
          placeholder="请输入材质"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计重方式" prop="weightMode">
        <el-select v-model="queryParams.weightMode" placeholder="请选择计重方式" clearable>
          <el-option
            v-for="dict in dict.type.weight_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="重量(吨)" prop="weight">
        <el-input
          v-model="queryParams.weight"
          placeholder="请输入重量(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="磅重(吨)" prop="poundWeight">
        <el-input
          v-model="queryParams.poundWeight"
          placeholder="请输入磅重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="理重(吨)" prop="theoryWeight">
        <el-input
          v-model="queryParams.theoryWeight"
          placeholder="请输入理重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="毛重(吨)" prop="grossWeight">
        <el-input
          v-model="queryParams.grossWeight"
          placeholder="请输入毛重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="皮重(吨)" prop="tareWeight">
        <el-input
          v-model="queryParams.tareWeight"
          placeholder="请输入皮重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="净重(吨)" prop="netWeight">
        <el-input
          v-model="queryParams.netWeight"
          placeholder="请输入净重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="扣重(吨)" prop="deductWeight">
        <el-input
          v-model="queryParams.deductWeight"
          placeholder="请输入扣重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="件数" prop="numberOfPiece">
        <el-input
          v-model="queryParams.numberOfPiece"
          placeholder="请输入件数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="合约号" prop="agreementNumber">
        <el-input
          v-model="queryParams.agreementNumber"
          placeholder="请输入合约号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <el-form-item label="合同号" prop="contractNumber">
        <el-input
          v-model="queryParams.contractNumber"
          placeholder="请输入合同号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--el-form-item label="生产日期">
        <el-date-picker
          v-model="daterangeProduceDate"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="切边" prop="trimEdge">
        <el-input
          v-model="queryParams.trimEdge"
          placeholder="请输入切边"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="记录来源" prop="recordSource">
        <el-input
          v-model="queryParams.recordSource"
          placeholder="请输入记录来源"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <el-form-item label="库存状态" prop="inventoryStatus">
        <el-select v-model="queryParams.inventoryStatus" placeholder="请选择库存状态" clearable>
          <el-option
            v-for="dict in dict.type.inventory_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <!--el-form-item label="仓库类型" prop="warehouseType">
        <el-select v-model="queryParams.warehouseType" placeholder="请选择仓库类型" clearable>
          <el-option
            v-for="dict in dict.type.warehouse_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <!--el-form-item label="园区信息" prop="logisticsParkName">
        <el-select v-model="queryParams.logisticsParkName" placeholder="请选择园区信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="仓位信息" prop="warehouseLocateName">
        <el-select v-model="queryParams.warehouseLocateName" placeholder="请选择仓位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="区位信息" prop="regionLocateName">
        <el-select v-model="queryParams.regionLocateName" placeholder="请选择区位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="货位信息" prop="goodsLocateName">
        <el-select v-model="queryParams.goodsLocateName" placeholder="请选择货位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <!--el-form-item label="层位信息" prop="layerLocateName">
        <el-select v-model="queryParams.layerLocateName" placeholder="请选择层位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="库位信息" prop="warehouseTotalLocate">
        <el-input
          v-model="queryParams.warehouseTotalLocate"
          placeholder="请输入库位信息"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库单号" prop="enterWarehouseNumber">
        <el-input
          v-model="queryParams.enterWarehouseNumber"
          placeholder="请输入入库单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库查验" prop="enterWarehouseCheck">
        <el-select v-model="queryParams.enterWarehouseCheck" placeholder="请选择入库查验" clearable>
          <el-option
            v-for="dict in dict.type.check_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <el-form-item label="入库客户" prop="enterWarehouseCustomer">
        <el-select v-model="queryParams.enterWarehouseCustomer" placeholder="请选择入库客户" clearable filterable>
          <el-option
            v-for="dict in customerOptions"
            :key="dict.customerId"
            :label="dict.customerName"
            :value="dict.customerName"
          />
        </el-select>
      </el-form-item>
      <!--el-form-item label="入库司机" prop="enterWarehouseDriver">
        <el-input
          v-model="queryParams.enterWarehouseDriver"
          placeholder="请输入入库司机"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库车号" prop="enterWarehouseVehicle">
        <el-input
          v-model="queryParams.enterWarehouseVehicle"
          placeholder="请输入入库车号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库运输" prop="enterTransportMark">
        <el-select v-model="queryParams.enterTransportMark" placeholder="请选择入库运输" clearable>
          <el-option
            v-for="dict in dict.type.transport_mark"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="入库人" prop="enterWarehousePerson">
        <el-input
          v-model="queryParams.enterWarehousePerson"
          placeholder="请输入入库人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <el-form-item label="入库时间">
        <el-date-picker
          v-model="daterangeEnterWarehouseTime"
          style="width: 485px"
          value-format="yyyy-MM-dd HH:mm:ss" 
          type="datetimerange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <!--el-form-item label="入库确认人" prop="enterWarehouseConfirmPerson">
        <el-input
          v-model="queryParams.enterWarehouseConfirmPerson"
          placeholder="请输入入库确认人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入库确认时间">
        <el-date-picker
          v-model="daterangeEnterWarehouseConfirmTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="出库单号" prop="exitWarehouseNumber">
        <el-input
          v-model="queryParams.exitWarehouseNumber"
          placeholder="请输入出库单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出库查验" prop="exitWarehouseCheck">
        <el-select v-model="queryParams.exitWarehouseCheck" placeholder="请选择出库查验" clearable>
          <el-option
            v-for="dict in dict.type.check_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <el-form-item label="出库客户" prop="exitWarehouseCustomer">
        <el-select v-model="queryParams.exitWarehouseCustomer" placeholder="请选择出库客户" clearable filterable>
          <el-option
            v-for="dict in customerOptions"
            :key="dict.customerId"
            :label="dict.customerName"
            :value="dict.customerName"
          />
        </el-select>
      </el-form-item>
      <!--el-form-item label="出库司机" prop="exitWarehouseDriver">
        <el-input
          v-model="queryParams.exitWarehouseDriver"
          placeholder="请输入出库司机"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出库车号" prop="exitWarehouseVehicle">
        <el-input
          v-model="queryParams.exitWarehouseVehicle"
          placeholder="请输入出库车号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="出库运输" prop="exitTransportMark">
        <el-select v-model="queryParams.exitTransportMark" placeholder="请选择出库运输" clearable>
          <el-option
            v-for="dict in dict.type.transport_mark"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <!--el-form-item label="出库人" prop="exitWarehousePerson">
        <el-input
          v-model="queryParams.exitWarehousePerson"
          placeholder="请输入出库人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <el-form-item label="出库时间">
        <el-date-picker
          v-model="daterangeExitWarehouseTime"
          style="width: 485px"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetimerange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <!--el-form-item label="出库确认人" prop="exitWarehouseConfirmPerson">
        <el-input
          v-model="queryParams.exitWarehouseConfirmPerson"
          placeholder="请输入出库确认人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出库确认时间">
        <el-date-picker
          v-model="daterangeExitWarehouseConfirmTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="理货人" prop="adjustGoodsPerson">
        <el-input
          v-model="queryParams.adjustGoodsPerson"
          placeholder="请输入理货人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="理货时间">
        <el-date-picker
          v-model="daterangeAdjustGoodsTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="盘货状态" prop="checkGoodsStatus">
        <el-select v-model="queryParams.checkGoodsStatus" placeholder="请选择盘货状态" clearable>
          <el-option
            v-for="dict in dict.type.check_goods_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="盘货人" prop="checkGoodsPerson">
        <el-input
          v-model="queryParams.checkGoodsPerson"
          placeholder="请输入盘货人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="盘货时间">
        <el-date-picker
          v-model="daterangeCheckGoodsTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="原货权客户" prop="originGoodsRightCustomer">
        <el-select v-model="queryParams.originGoodsRightCustomer" placeholder="请选择原货权客户" clearable filterable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item-->
      <el-form-item label="货权客户" prop="goodsRightCustomer">
        <el-select v-model="queryParams.goodsRightCustomer" placeholder="请选择货权客户" clearable filterable>
          <el-option
            v-for="dict in customerOptions"
            :key="dict.customerId"
            :label="dict.customerName"
            :value="dict.customerName"
          />
        </el-select>
      </el-form-item>
      <!--el-form-item label="货转次数" prop="goodsTransferTimes">
        <el-input
          v-model="queryParams.goodsTransferTimes"
          placeholder="请输入货转次数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货转单号" prop="goodsTransferNumber">
        <el-input
          v-model="queryParams.goodsTransferNumber"
          placeholder="请输入货转单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货转人" prop="goodsTransferPerson">
        <el-input
          v-model="queryParams.goodsTransferPerson"
          placeholder="请输入货转人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货转时间">
        <el-date-picker
          v-model="daterangeGoodsTransferTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="货转审核人" prop="goodsTransferAuditPerson">
        <el-input
          v-model="queryParams.goodsTransferAuditPerson"
          placeholder="请输入货转审核人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货转审核时间">
        <el-date-picker
          v-model="daterangeGoodsTransferAuditTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="货转单IDs" prop="goodsTransferIds">
        <el-input
          v-model="queryParams.goodsTransferIds"
          placeholder="请输入货转单IDs"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="室内库(元/吨)" prop="indoorWarehousePrice">
        <el-input
          v-model="queryParams.indoorWarehousePrice"
          placeholder="请输入室内库(元/吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="室外库(元/吨)" prop="outdoorWarehousePrice">
        <el-input
          v-model="queryParams.outdoorWarehousePrice"
          placeholder="请输入室外库(元/吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仓储费" prop="storageFee">
        <el-input
          v-model="queryParams.storageFee"
          placeholder="请输入仓储费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="免堆期(天)" prop="freeStorage">
        <el-input
          v-model="queryParams.freeStorage"
          placeholder="请输入免堆期(天)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="超期计价" prop="overduePriceMode">
        <el-input
          v-model="queryParams.overduePriceMode"
          placeholder="请输入超期计价"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="超期单价(元/吨)" prop="overduePrice">
        <el-input
          v-model="queryParams.overduePrice"
          placeholder="请输入超期单价(元/吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库存天数" prop="storageDay">
        <el-input
          v-model="queryParams.storageDay"
          placeholder="请输入库存天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="超期费" prop="overdueFee">
        <el-input
          v-model="queryParams.overdueFee"
          placeholder="请输入超期费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="倒垛单价(元/吨)" prop="stackTransferPrice">
        <el-input
          v-model="queryParams.stackTransferPrice"
          placeholder="请输入倒垛单价(元/吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="倒垛费" prop="stackTransferFee">
        <el-input
          v-model="queryParams.stackTransferFee"
          placeholder="请输入倒垛费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仓费结算账单号" prop="warehouseSettlementBillNumber">
        <el-input
          v-model="queryParams.warehouseSettlementBillNumber"
          placeholder="请输入仓费结算账单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仓费结算客户" prop="warehouseSettlementCustomer">
        <el-select v-model="queryParams.warehouseSettlementCustomer" placeholder="请选择仓费结算客户" clearable filterable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="是否货损" prop="goodsDamage">
        <el-select v-model="queryParams.goodsDamage" placeholder="请选择是否货损" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="货物备注" prop="goodsRemark">
        <el-input
          v-model="queryParams.goodsRemark"
          placeholder="请输入货物备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="配货状态" prop="distributeGoodsStatus">
        <el-select v-model="queryParams.distributeGoodsStatus" placeholder="请选择配货状态" clearable>
          <el-option
            v-for="dict in dict.type.distribute_goods_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="配货车" prop="distributeGoodsCart">
        <el-input
          v-model="queryParams.distributeGoodsCart"
          placeholder="请输入配货车"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="发货客户" prop="sendGoodsCustomer">
        <el-select v-model="queryParams.sendGoodsCustomer" placeholder="请选择发货客户" clearable filterable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="目的流向" prop="endFlowDirection">
        <el-select v-model="queryParams.endFlowDirection" placeholder="请选择目的流向" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="目的卸点" prop="endUnloadPoint">
        <el-input
          v-model="queryParams.endUnloadPoint"
          placeholder="请输入目的卸点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="运单编号" prop="wayBillNumber">
        <el-input
          v-model="queryParams.wayBillNumber"
          placeholder="请输入运单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="付费方式" prop="paymentMode">
        <el-select v-model="queryParams.paymentMode" placeholder="请选择付费方式" clearable>
          <el-option
            v-for="dict in dict.type.settlement_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="运费计价" prop="freightPriceMode">
        <el-select v-model="queryParams.freightPriceMode" placeholder="请选择运费计价" clearable>
          <el-option
            v-for="dict in dict.type.price_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="运费价格" prop="freightPrice">
        <el-input
          v-model="queryParams.freightPrice"
          placeholder="请输入运费价格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="运费金额" prop="freightAmount">
        <el-input
          v-model="queryParams.freightAmount"
          placeholder="请输入运费金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="运费补贴" prop="primage">
        <el-input
          v-model="queryParams.primage"
          placeholder="请输入运费补贴"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="运费总额" prop="freightTotalAmount">
        <el-input
          v-model="queryParams.freightTotalAmount"
          placeholder="请输入运费总额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结算方式" prop="settlementMethod">
        <el-select v-model="queryParams.settlementMethod" placeholder="请选择结算方式" clearable>
          <el-option
            v-for="dict in dict.type.settlement_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="结算计价" prop="settlementPriceMode">
        <el-select v-model="queryParams.settlementPriceMode" placeholder="请选择结算计价" clearable>
          <el-option
            v-for="dict in dict.type.price_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="结算价格" prop="settlementPrice">
        <el-input
          v-model="queryParams.settlementPrice"
          placeholder="请输入结算价格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结算金额" prop="settlementAmount">
        <el-input
          v-model="queryParams.settlementAmount"
          placeholder="请输入结算金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="附加运费" prop="premiumFreight">
        <el-input
          v-model="queryParams.premiumFreight"
          placeholder="请输入附加运费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结算总额" prop="settlementTotalAmount">
        <el-input
          v-model="queryParams.settlementTotalAmount"
          placeholder="请输入结算总额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货运付费账单号" prop="freightPaymentBillNumber">
        <el-input
          v-model="queryParams.freightPaymentBillNumber"
          placeholder="请输入货运付费账单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货运结算账单号" prop="freightSettlementBillNumber">
        <el-input
          v-model="queryParams.freightSettlementBillNumber"
          placeholder="请输入货运结算账单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="其他编号" prop="otherNumber">
        <el-input
          v-model="queryParams.otherNumber"
          placeholder="请输入其他编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="三方编号" prop="threePartyNumber">
        <el-input
          v-model="queryParams.threePartyNumber"
          placeholder="请输入三方编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区代码" prop="parkCode">
        <el-input
          v-model="queryParams.parkCode"
          placeholder="请输入园区代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="创建者" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <!--el-form-item label="创建时间">
        <el-date-picker
          v-model="daterangeCreateTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item-->
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['goods:good:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['goods:good:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['goods:good:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['goods:good:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-magic-stick"
          size="mini"
          @click="handleShowId"
          v-hasPermi="['goods:good:showid']"
         >货物ID</el-button>
      </el-col>
      <!--el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleGoodsWeighSum"
          
        >合计</el-button>
      </el-col-->
      <!-- div v-for="(item, index) in goodsWeightSumList" :key="index"-->
      <el-col :span="1.5" v-for="(item, index) in goodsWeightSumList" :key="index">
        <!--h3 >货物详情</h3-->
        <el-tag type="" size="medium" effect="dark" >{{ item.inventoryStatus }} : {{ item.weightSum }}</el-tag>
      </el-col>
      <el-col :span="1.5">
        <el-tag type="" size="medium" effect="dark" >已选重 : {{ selectedGoodsSum }}</el-tag>
      </el-col>
      <!--/div -->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" @computeTable="computeTableHeight"></right-toolbar>
    </el-row>

    <el-table ref="goodTable" v-loading="loading" :data="goodList" @selection-change="handleSelectionChange" border :height="tableHeight" :row-style="{height:'35px'}" :cell-style="{padding:'0px'}">
      <el-table-column type="selection" width="45" align="center" />
      <el-table-column type="index" prop="" width="65" label="序号" align="center" >
        <template slot-scope="scope">
          <span>{{ scope.$index+1 +(queryParams.pageNum-1)*queryParams.pageSize }}</span>
        </template>
      </el-table-column>
      <!--el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100%">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['goods:good:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['goods:good:remove']"
          >删除</el-button>
        </template>
      </el-table-column-->
      <el-table-column v-if="showId" label="货物ID" align="center" prop="goodsId" />
      <el-table-column label="捆包号" align="center" prop="bundleNumber" width="180" :show-overflow-tooltip="true" />
      <el-table-column label="货物类型" align="center" prop="goodsType" />
      <el-table-column label="品名" align="center" prop="product" />
      <el-table-column label="规格" align="center" prop="specification" width="130" :show-overflow-tooltip="true" />
      <el-table-column label="材质" align="center" prop="steelGrade" width="110" :show-overflow-tooltip="true" />
      <!--el-table-column label="计重方式" align="center" prop="weightMode" /-->
      <el-table-column label="重量(吨)" align="center" prop="weight" />
      <!--el-table-column label="磅重(吨)" align="center" prop="poundWeight" /-->
      <!--el-table-column label="理重(吨)" align="center" prop="theoryWeight" width="90" /-->
      <!--el-table-column label="毛重(吨)" align="center" prop="grossWeight" />
      <el-table-column label="皮重(吨)" align="center" prop="tareWeight" />
      <el-table-column label="净重(吨)" align="center" prop="netWeight" />
      <el-table-column label="扣重(吨)" align="center" prop="deductWeight" /-->
      <el-table-column label="件数" align="center" prop="numberOfPiece" />
      <!--el-table-column label="合约号" align="center" prop="agreementNumber" width="110" :show-overflow-tooltip="true" /-->
      <el-table-column label="合同号" align="center" prop="contractNumber" width="160" :show-overflow-tooltip="true" />
      <!--el-table-column label="生产日期" align="center" prop="produceDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.produceDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column-->
      <el-table-column label="切边" align="center" prop="trimEdge" />
      <el-table-column label="记录来源" align="center" prop="recordSource" />
      <el-table-column label="库存状态" align="center" prop="inventoryStatus" />
      <el-table-column label="仓库类型" align="center" prop="warehouseType" />
      <el-table-column label="园区信息" align="center" prop="logisticsParkName" />
      <el-table-column label="仓位信息" align="center" prop="warehouseLocateName" />
      <el-table-column label="区位信息" align="center" prop="regionLocateName" />
      <el-table-column label="货位信息" align="center" prop="goodsLocateName" />
      <!--el-table-column label="层位信息" align="center" prop="layerLocateName" /-->
      <el-table-column label="库位信息" align="center" prop="warehouseTotalLocate" width="160" :show-overflow-tooltip="true"/>
      <el-table-column label="入库单号" align="center" prop="enterWarehouseNumber" width="160" />
      <!--el-table-column label="入库查验" align="center" prop="enterWarehouseCheck" /-->
      <el-table-column label="入库客户" align="center" prop="enterWarehouseCustomer" width="240" :show-overflow-tooltip="true" />
      <el-table-column label="入库司机" align="center" prop="enterWarehouseDriver" />
      <el-table-column label="入库车号" align="center" prop="enterWarehouseVehicle" width="110" :show-overflow-tooltip="true" />
      <!--el-table-column label="入库运输" align="center" prop="enterTransportMark" /-->
      <el-table-column label="入库人" align="center" prop="enterWarehousePerson" />
      <el-table-column label="入库时间" align="center" prop="enterWarehouseTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.enterWarehouseTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="入库确认人" align="center" prop="enterWarehouseConfirmPerson" width="90" />
      <el-table-column label="入库确认时间" align="center" prop="enterWarehouseConfirmTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.enterWarehouseConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="出库单号" align="center" prop="exitWarehouseNumber" width="160" />
      <!--el-table-column label="出库查验" align="center" prop="exitWarehouseCheck" /-->
      <el-table-column label="出库客户" align="center" prop="exitWarehouseCustomer" width="240" :show-overflow-tooltip="true" />
      <el-table-column label="出库司机" align="center" prop="exitWarehouseDriver" />
      <el-table-column label="出库车号" align="center" prop="exitWarehouseVehicle" width="110" />
      <el-table-column label="出库运输" align="center" prop="exitTransportMark" />
      <el-table-column label="出库人" align="center" prop="exitWarehousePerson" />
      <el-table-column label="出库时间" align="center" prop="exitWarehouseTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.exitWarehouseTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="出库确认人" align="center" prop="exitWarehouseConfirmPerson" width="90" />
      <el-table-column label="出库确认时间" align="center" prop="exitWarehouseConfirmTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.exitWarehouseConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="理货人" align="center" prop="adjustGoodsPerson" />
      <el-table-column label="理货时间" align="center" prop="adjustGoodsTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.adjustGoodsTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <!--el-table-column label="盘货状态" align="center" prop="checkGoodsStatus" />
      <el-table-column label="盘货人" align="center" prop="checkGoodsPerson" />
      <el-table-column label="盘货时间" align="center" prop="checkGoodsTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.checkGoodsTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="原货权客户" align="center" prop="originGoodsRightCustomer" width="240" :show-overflow-tooltip="true" /-->
      <el-table-column label="货权客户" align="center" prop="goodsRightCustomer" width="240" :show-overflow-tooltip="true" />
      <el-table-column label="货转次数" align="center" prop="goodsTransferTimes" />
      <!--el-table-column label="货转单号" align="center" prop="goodsTransferNumber" width="160" :show-overflow-tooltip="true" /-->
      <el-table-column label="货转人" align="center" prop="goodsTransferPerson" />
      <el-table-column label="货转时间" align="center" prop="goodsTransferTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.goodsTransferTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="货转审核人" align="center" prop="goodsTransferAuditPerson" width="90" />
      <el-table-column label="货转审核时间" align="center" prop="goodsTransferAuditTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.goodsTransferAuditTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <!--el-table-column label="货转单IDs" align="center" prop="goodsTransferIds" width="90"/-->
      <!--el-table-column label="室内库(元/吨)" align="center" prop="indoorWarehousePrice" width="110"/>
      <el-table-column label="室外库(元/吨)" align="center" prop="outdoorWarehousePrice" width="110"/>
      <el-table-column label="仓储费" align="center" prop="storageFee" />
      <el-table-column label="免堆期(天)" align="center" prop="freeStorage" width="110"/>
      <el-table-column label="超期计价" align="center" prop="overduePriceMode" />
      <el-table-column label="超期单价(元/吨)" align="center" prop="overduePrice" width="120"/>
      <el-table-column label="库存天数" align="center" prop="storageDay" />
      <el-table-column label="超期费" align="center" prop="overdueFee" />
      <el-table-column label="倒垛单价(元/吨)" align="center" prop="stackTransferPrice" width="120"/>
      <el-table-column label="倒垛费" align="center" prop="stackTransferFee" />
      <el-table-column label="仓费结算账单号" align="center" prop="warehouseSettlementBillNumber"  width="160"/>
      <el-table-column label="仓费结算客户" align="center" prop="warehouseSettlementCustomer" width="240" :show-overflow-tooltip="true" /-->
      <el-table-column label="是否货损" align="center" prop="goodsDamage">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.goodsDamage" />
        </template>
      </el-table-column>
      <el-table-column label="货损照片" align="center" prop="goodsDamagePicture" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.goodsDamagePicture" :width="50" :height="25"/>
        </template>
      </el-table-column>
      <el-table-column label="货物备注" align="center" prop="goodsRemark"  width="160" :show-overflow-tooltip="true" />
      <!--el-table-column label="配货状态" align="center" prop="distributeGoodsStatus" />
      <el-table-column label="配货车" align="center" prop="distributeGoodsCart" width="90" />
      <el-table-column label="发货客户" align="center" prop="sendGoodsCustomer" width="240" :show-overflow-tooltip="true" />
      <el-table-column label="目的流向" align="center" prop="endFlowDirection" width="280" :show-overflow-tooltip="true" />
      <el-table-column label="目的卸点" align="center" prop="endUnloadPoint" />
      <el-table-column label="运单编号" align="center" prop="wayBillNumber" width="100" />
      <el-table-column label="付费方式" align="center" prop="paymentMode" />
      <el-table-column label="运费计价" align="center" prop="freightPriceMode" />
      <el-table-column label="运费价格" align="center" prop="freightPrice" />
      <el-table-column label="运费金额" align="center" prop="freightAmount" />
      <el-table-column label="运费补贴" align="center" prop="primage" />
      <el-table-column label="运费总额" align="center" prop="freightTotalAmount" />
      <el-table-column label="结算方式" align="center" prop="settlementMethod" />
      <el-table-column label="结算计价" align="center" prop="settlementPriceMode" />
      <el-table-column label="结算价格" align="center" prop="settlementPrice" />
      <el-table-column label="结算金额" align="center" prop="settlementAmount" />
      <el-table-column label="附加运费" align="center" prop="premiumFreight" />
      <el-table-column label="结算总额" align="center" prop="settlementTotalAmount" />
      <el-table-column label="货运付费账单号" align="center" prop="freightPaymentBillNumber"  width="160"/>
      <el-table-column label="货运结算账单号" align="center" prop="freightSettlementBillNumber"  width="160"/-->
      <el-table-column label="其他编号" align="center" prop="otherNumber" width="100" :show-overflow-tooltip="true" />
      <el-table-column label="三方编号" align="center" prop="threePartyNumber" width="130" :show-overflow-tooltip="true" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改货物信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-form-item label="捆包号" prop="bundleNumber">
          <el-input v-model="form.bundleNumber" placeholder="请输入捆包号" clearable />
        </el-form-item>
        <el-form-item label="货物类型" prop="goodsType">
          <el-select v-model="form.goodsType" placeholder="请选择货物类型" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.goods_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="品名" prop="product">
          <el-input v-model="form.product" placeholder="请输入品名" clearable />
        </el-form-item>
        <el-form-item label="规格" prop="specification">
          <el-input v-model="form.specification" placeholder="请输入规格" clearable />
        </el-form-item>
        <el-form-item label="材质" prop="steelGrade">
          <el-input v-model="form.steelGrade" placeholder="请输入材质" clearable />
        </el-form-item>
        <el-form-item label="计重方式" prop="weightMode">
          <el-select v-model="form.weightMode" placeholder="请选择计重方式" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.weight_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="重量(吨)" prop="weight">
          <el-input v-model="form.weight" placeholder="请输入重量(吨)" clearable />
        </el-form-item>
        <el-form-item label="磅重(吨)" prop="poundWeight">
          <el-input v-model="form.poundWeight" placeholder="请输入磅重(吨)" clearable />
        </el-form-item>
        <el-form-item label="理重(吨)" prop="theoryWeight">
          <el-input v-model="form.theoryWeight" placeholder="请输入理重(吨)" clearable />
        </el-form-item>
        <!--el-form-item label="毛重(吨)" prop="grossWeight">
          <el-input v-model="form.grossWeight" placeholder="请输入毛重(吨)" clearable />
        </el-form-item>
        <el-form-item label="皮重(吨)" prop="tareWeight">
          <el-input v-model="form.tareWeight" placeholder="请输入皮重(吨)" clearable />
        </el-form-item>
        <el-form-item label="净重(吨)" prop="netWeight">
          <el-input v-model="form.netWeight" placeholder="请输入净重(吨)" clearable />
        </el-form-item>
        <el-form-item label="扣重(吨)" prop="deductWeight">
          <el-input v-model="form.deductWeight" placeholder="请输入扣重(吨)" clearable />
        </el-form-item-->
        <el-form-item label="件数" prop="numberOfPiece">
          <el-input v-model="form.numberOfPiece" placeholder="请输入件数" clearable />
        </el-form-item>
        <!--el-form-item label="合约号" prop="agreementNumber">
          <el-input v-model="form.agreementNumber" placeholder="请输入合约号" clearable />
        </el-form-item-->
        <el-form-item label="合同号" prop="contractNumber">
          <el-input v-model="form.contractNumber" placeholder="请输入合同号" clearable />
        </el-form-item>
        <!--el-form-item label="生产日期" prop="produceDate">
          <el-date-picker clearable
            v-model="form.produceDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择生产日期"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item-->
        <el-form-item label="切边" prop="trimEdge">
          <el-input v-model="form.trimEdge" placeholder="请输入切边" clearable />
        </el-form-item>
        <el-form-item label="记录来源" prop="recordSource">
          <el-input v-model="form.recordSource" placeholder="请输入记录来源" clearable />
        </el-form-item>
        <el-form-item label="库存状态" prop="inventoryStatus">
          <el-select v-model="form.inventoryStatus" placeholder="请选择库存状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.inventory_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="仓库类型" prop="warehouseType">
          <el-select v-model="form.warehouseType" placeholder="请选择仓库类型" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.warehouse_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="园区信息" prop="logisticsParkName">
          <el-select ref="optionRef" v-model="form.logisticsParkName" placeholder="请选择园区信息" style="width: 340px;" clearable @change="handleChangeLogisticsPark">
            <el-option
              v-for="dict in parkLocateOptions"
              :key="dict.locateId"
              :label="dict.name"
              :value="dict.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="仓位信息" prop="warehouseLocateName">
          <el-select v-model="form.warehouseLocateName" placeholder="请选择仓位信息" style="width: 340px;" clearable @change="handleChangeWarehouseLocate">
            <el-option
              v-for="dict in warehouseLocateOptions"
              :key="dict.locateId"
              :label="dict.name"
              :value="dict.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="区位信息" prop="regionLocateName">
          <el-select v-model="form.regionLocateName" placeholder="请选择区位信息" style="width: 340px;" clearable @change="handleChangeRegionLocate">
            <el-option
              v-for="dict in regionLocateOptions"
              :key="dict.locateId"
              :label="dict.name"
              :value="dict.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货位信息" prop="goodsLocateName">
          <el-select v-model="form.goodsLocateName" placeholder="请选择货位信息" style="width: 340px;" clearable @change="handleChangeGoodsLocate">
            <el-option
              v-for="dict in goodsLocateOptions"
              :key="dict.locateId"
              :label="dict.name"
              :value="dict.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <!--el-form-item label="层位信息" prop="layerLocateName">
          <el-select v-model="form.layerLocateName" placeholder="请选择层位信息" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="库位信息" prop="warehouseTotalLocate">
          <el-input v-model="form.warehouseTotalLocate" placeholder="请输入库位信息" clearable />
        </el-form-item>
        <el-form-item label="入库单号" prop="enterWarehouseNumber">
          <el-input v-model="form.enterWarehouseNumber" placeholder="请输入入库单号" clearable />
        </el-form-item>
        <!--el-form-item label="入库查验" prop="enterWarehouseCheck">
          <el-select v-model="form.enterWarehouseCheck" placeholder="请选择入库查验" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.check_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="入库客户" prop="enterWarehouseCustomer">
          <el-select v-model="form.enterWarehouseCustomer" placeholder="请选择入库客户" style="width: 340px;" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="入库司机" prop="enterWarehouseDriver">
          <el-input v-model="form.enterWarehouseDriver" placeholder="请输入入库司机" clearable />
        </el-form-item>
        <el-form-item label="入库车号" prop="enterWarehouseVehicle">
          <el-input v-model="form.enterWarehouseVehicle" placeholder="请输入入库车号" clearable />
        </el-form-item>
        <!--el-form-item label="入库运输" prop="enterTransportMark">
          <el-select v-model="form.enterTransportMark" placeholder="请选择入库运输" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.transport_mark"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="入库人" prop="enterWarehousePerson">
          <el-input v-model="form.enterWarehousePerson" placeholder="请输入入库人" clearable />
        </el-form-item>
        <el-form-item label="入库时间" prop="enterWarehouseTime">
          <el-date-picker clearable
            v-model="form.enterWarehouseTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择入库时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="入库确认人" prop="enterWarehouseConfirmPerson">
          <el-input v-model="form.enterWarehouseConfirmPerson" placeholder="请输入入库确认人" clearable />
        </el-form-item>
        <el-form-item label="入库确认时间" prop="enterWarehouseConfirmTime">
          <el-date-picker clearable
            v-model="form.enterWarehouseConfirmTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择入库确认时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出库单号" prop="exitWarehouseNumber">
          <el-input v-model="form.exitWarehouseNumber" placeholder="请输入出库单号" clearable />
        </el-form-item>
        <!--el-form-item label="出库查验" prop="exitWarehouseCheck">
          <el-select v-model="form.exitWarehouseCheck" placeholder="请选择出库查验" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.check_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="出库客户" prop="exitWarehouseCustomer">
          <el-select v-model="form.exitWarehouseCustomer" placeholder="请选择出库客户" style="width: 340px;" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="出库司机" prop="exitWarehouseDriver">
          <el-input v-model="form.exitWarehouseDriver" placeholder="请输入出库司机" clearable />
        </el-form-item>
        <el-form-item label="出库车号" prop="exitWarehouseVehicle">
          <el-input v-model="form.exitWarehouseVehicle" placeholder="请输入出库车号" clearable />
        </el-form-item>
        <el-form-item label="出库运输" prop="exitTransportMark">
          <el-select v-model="form.exitTransportMark" placeholder="请选择出库运输" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.transport_mark"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="出库人" prop="exitWarehousePerson">
          <el-input v-model="form.exitWarehousePerson" placeholder="请输入出库人" clearable />
        </el-form-item>
        <el-form-item label="出库时间" prop="exitWarehouseTime">
          <el-date-picker clearable
            v-model="form.exitWarehouseTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择出库时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="出库确认人" prop="exitWarehouseConfirmPerson">
          <el-input v-model="form.exitWarehouseConfirmPerson" placeholder="请输入出库确认人" clearable />
        </el-form-item>
        <el-form-item label="出库确认时间" prop="exitWarehouseConfirmTime">
          <el-date-picker clearable
            v-model="form.exitWarehouseConfirmTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择出库确认时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="理货人" prop="adjustGoodsPerson">
          <el-input v-model="form.adjustGoodsPerson" placeholder="请输入理货人" clearable />
        </el-form-item>
        <el-form-item label="理货时间" prop="adjustGoodsTime">
          <el-date-picker clearable
            v-model="form.adjustGoodsTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择理货时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <!--el-form-item label="盘货状态" prop="checkGoodsStatus">
          <el-select v-model="form.checkGoodsStatus" placeholder="请选择盘货状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.check_goods_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="盘货人" prop="checkGoodsPerson">
          <el-input v-model="form.checkGoodsPerson" placeholder="请输入盘货人" clearable />
        </el-form-item>
        <el-form-item label="盘货时间" prop="checkGoodsTime">
          <el-date-picker clearable
            v-model="form.checkGoodsTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择盘货时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item-->
        <!--el-form-item label="原货权客户" prop="originGoodsRightCustomer">
          <el-select v-model="form.originGoodsRightCustomer" placeholder="请选择原货权客户" style="width: 340px;" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="货权客户" prop="goodsRightCustomer">
          <el-select v-model="form.goodsRightCustomer" placeholder="请选择货权客户" style="width: 340px;" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货转次数" prop="goodsTransferTimes">
          <el-input v-model="form.goodsTransferTimes" placeholder="请输入货转次数" clearable />
        </el-form-item>
        <!--el-form-item label="货转单号" prop="goodsTransferNumber">
          <el-input v-model="form.goodsTransferNumber" placeholder="请输入货转单号" clearable />
        </el-form-item-->
        <el-form-item label="货转人" prop="goodsTransferPerson">
          <el-input v-model="form.goodsTransferPerson" placeholder="请输入货转人" clearable />
        </el-form-item>
        <el-form-item label="货转时间" prop="goodsTransferTime">
          <el-date-picker clearable
            v-model="form.goodsTransferTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择货转时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="货转审核人" prop="goodsTransferAuditPerson">
          <el-input v-model="form.goodsTransferAuditPerson" placeholder="请输入货转审核人" clearable />
        </el-form-item>
        <el-form-item label="货转审核时间" prop="goodsTransferAuditTime">
          <el-date-picker clearable
            v-model="form.goodsTransferAuditTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择货转审核时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <!--el-form-item label="货转单IDs" prop="goodsTransferIds">
          <el-input v-model="form.goodsTransferIds" placeholder="请输入货转单IDs" clearable />
        </el-form-item-->
        <!--el-form-item label="室内库(元/吨)" prop="indoorWarehousePrice">
          <el-input v-model="form.indoorWarehousePrice" placeholder="请输入室内库(元/吨)" clearable />
        </el-form-item>
        <el-form-item label="室外库(元/吨)" prop="outdoorWarehousePrice">
          <el-input v-model="form.outdoorWarehousePrice" placeholder="请输入室外库(元/吨)" clearable />
        </el-form-item>
        <el-form-item label="仓储费" prop="storageFee">
          <el-input v-model="form.storageFee" placeholder="请输入仓储费" clearable />
        </el-form-item>
        <el-form-item label="免堆期(天)" prop="freeStorage">
          <el-input v-model="form.freeStorage" placeholder="请输入免堆期(天)" clearable />
        </el-form-item>
        <el-form-item label="超期计价" prop="overduePriceMode">
          <el-input v-model="form.overduePriceMode" placeholder="请输入超期计价" clearable />
        </el-form-item>
        <el-form-item label="超期单价(元/吨)" prop="overduePrice">
          <el-input v-model="form.overduePrice" placeholder="请输入超期单价(元/吨)" clearable />
        </el-form-item>
        <el-form-item label="库存天数" prop="storageDay">
          <el-input v-model="form.storageDay" placeholder="请输入库存天数" clearable />
        </el-form-item>
        <el-form-item label="超期费" prop="overdueFee">
          <el-input v-model="form.overdueFee" placeholder="请输入超期费" clearable />
        </el-form-item>
        <el-form-item label="倒垛单价(元/吨)" prop="stackTransferPrice">
          <el-input v-model="form.stackTransferPrice" placeholder="请输入倒垛单价(元/吨)" clearable />
        </el-form-item>
        <el-form-item label="倒垛费" prop="stackTransferFee">
          <el-input v-model="form.stackTransferFee" placeholder="请输入倒垛费" clearable />
        </el-form-item>
        <el-form-item label="仓费结算账单号" prop="warehouseSettlementBillNumber">
          <el-input v-model="form.warehouseSettlementBillNumber" placeholder="请输入仓费结算账单号" clearable />
        </el-form-item>
        <el-form-item label="仓费结算客户" prop="warehouseSettlementCustomer">
          <el-select v-model="form.warehouseSettlementCustomer" placeholder="请选择仓费结算客户" style="width: 340px;" clearable>
            <el-option
              v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="是否货损" prop="goodsDamage">
          <el-select v-model="form.goodsDamage" placeholder="请选择是否货损" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货损照片" prop="goodsDamagePicture">
          <image-upload v-model="form.goodsDamagePicture" :limit="2"/>
        </el-form-item>
        <el-form-item label="货物备注" prop="goodsRemark">
          <el-input v-model="form.goodsRemark" placeholder="请输入货物备注" clearable />
        </el-form-item>
        <!--el-form-item label="配货状态" prop="distributeGoodsStatus">
          <el-select v-model="form.distributeGoodsStatus" placeholder="请选择配货状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.distribute_goods_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="配货车" prop="distributeGoodsCart">
          <el-input v-model="form.distributeGoodsCart" placeholder="请输入配货车" clearable />
        </el-form-item>
        <el-form-item label="发货客户" prop="sendGoodsCustomer">
          <el-select v-model="form.sendGoodsCustomer" placeholder="请选择发货客户" style="width: 340px;" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="目的流向" prop="endFlowDirection">
          <el-select v-model="form.endFlowDirection" placeholder="请选择目的流向" style="width: 340px;" clearable>
            <el-option
              v-for="dict in endFlowOptions"
              :key="dict.flowDirectionId"
              :label="dict.flowDirectionName"
              :value="dict.flowDirectionName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="目的卸点" prop="endUnloadPoint">
          <el-input v-model="form.endUnloadPoint" placeholder="请输入目的卸点" clearable />
        </el-form-item>
        <el-form-item label="运单编号" prop="wayBillNumber">
          <el-input v-model="form.wayBillNumber" placeholder="请输入运单编号" clearable />
        </el-form-item>
        <el-form-item label="付费方式" prop="paymentMode">
          <el-select v-model="form.paymentMode" placeholder="请选择付费方式" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.settlement_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="运费计价" prop="freightPriceMode">
          <el-select v-model="form.freightPriceMode" placeholder="请选择运费计价" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.price_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="运费价格" prop="freightPrice">
          <el-input v-model="form.freightPrice" placeholder="请输入运费价格" clearable />
        </el-form-item>
        <el-form-item label="运费金额" prop="freightAmount">
          <el-input v-model="form.freightAmount" placeholder="请输入运费金额" clearable />
        </el-form-item>
        <el-form-item label="运费补贴" prop="primage">
          <el-input v-model="form.primage" placeholder="请输入运费补贴" clearable />
        </el-form-item>
        <el-form-item label="运费总额" prop="freightTotalAmount">
          <el-input v-model="form.freightTotalAmount" placeholder="请输入运费总额" clearable />
        </el-form-item>
        <el-form-item label="结算方式" prop="settlementMethod">
          <el-select v-model="form.settlementMethod" placeholder="请选择结算方式" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.settlement_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算计价" prop="settlementPriceMode">
          <el-select v-model="form.settlementPriceMode" placeholder="请选择结算计价" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.price_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算价格" prop="settlementPrice">
          <el-input v-model="form.settlementPrice" placeholder="请输入结算价格" clearable />
        </el-form-item>
        <el-form-item label="结算金额" prop="settlementAmount">
          <el-input v-model="form.settlementAmount" placeholder="请输入结算金额" clearable />
        </el-form-item>
        <el-form-item label="附加运费" prop="premiumFreight">
          <el-input v-model="form.premiumFreight" placeholder="请输入附加运费" clearable />
        </el-form-item>
        <el-form-item label="结算总额" prop="settlementTotalAmount">
          <el-input v-model="form.settlementTotalAmount" placeholder="请输入结算总额" clearable />
        </el-form-item>
        <el-form-item label="货运付费账单号" prop="freightPaymentBillNumber">
          <el-input v-model="form.freightPaymentBillNumber" placeholder="请输入货运付费账单号" clearable />
        </el-form-item>
        <el-form-item label="货运结算账单号" prop="freightSettlementBillNumber">
          <el-input v-model="form.freightSettlementBillNumber" placeholder="请输入货运结算账单号" clearable />
        </el-form-item-->
        <el-form-item label="其他编号" prop="otherNumber">
          <el-input v-model="form.otherNumber" placeholder="请输入其他编号" clearable />
        </el-form-item>
        <el-form-item label="三方编号" prop="threePartyNumber">
          <el-input v-model="form.threePartyNumber" placeholder="请输入三方编号" clearable />
        </el-form-item>
        <el-form-item label="园区代码" prop="parkCode">
          <el-input v-model="form.parkCode" placeholder="请输入园区代码" clearable />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listGood, listGoodExt, getGood, delGood, addGood, updateGood, getGoodsWeightSum } from "@/api/goods/good";
import { listCustomerOption } from "@/api/customs/custom";
import { listFlowOption, updateFlow } from "@/api/system/flow";
import { listLocateOption } from "@/api/locates/locate";
import { isNotNull } from "@/utils/validate";

export default {
  components: {
  },
  name: "Good",
  dicts: ['check_status', 'warehouse_type', 'sys_yes_no', 'settlement_mode', 'price_mode', 'distribute_goods_status', 'weight_mode', 'transport_mark', 'goods_type', 'inventory_status', 'check_goods_status'],
  data() {
    return {
      // 定义列表高度
      tableHeight: 430,
      // 定义查询高度
      queryHeight: 200,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 货物信息表格数据
      goodList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 园区代码时间范围
      daterangeProduceDate: [],
      // 园区代码时间范围
      daterangeEnterWarehouseTime: [],
      // 园区代码时间范围
      daterangeEnterWarehouseConfirmTime: [],
      // 园区代码时间范围
      daterangeExitWarehouseTime: [],
      // 园区代码时间范围
      daterangeExitWarehouseConfirmTime: [],
      // 园区代码时间范围
      daterangeAdjustGoodsTime: [],
      // 园区代码时间范围
      daterangeCheckGoodsTime: [],
      // 园区代码时间范围
      daterangeGoodsTransferTime: [],
      // 园区代码时间范围
      daterangeGoodsTransferAuditTime: [],
      // 园区代码时间范围
      daterangeCreateTime: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        bundleNumber: null,
        goodsType: null,
        product: null,
        specification: null,
        steelGrade: null,
        weightMode: null,
        weight: null,
        poundWeight: null,
        theoryWeight: null,
        grossWeight: null,
        tareWeight: null,
        netWeight: null,
        deductWeight: null,
        numberOfPiece: null,
        agreementNumber: null,
        contractNumber: null,
        produceDate: null,
        trimEdge: null,
        recordSource: null,
        inventoryStatus: null,
        warehouseType: null,
        logisticsParkName: null,
        warehouseLocateName: null,
        regionLocateName: null,
        goodsLocateName: null,
        layerLocateName: null,
        warehouseTotalLocate: null,
        enterWarehouseNumber: null,
        enterWarehouseCheck: null,
        enterWarehouseCustomer: null,
        enterWarehouseDriver: null,
        enterWarehouseVehicle: null,
        enterTransportMark: null,
        enterWarehousePerson: null,
        enterWarehouseTime: null,
        enterWarehouseConfirmPerson: null,
        enterWarehouseConfirmTime: null,
        exitWarehouseNumber: null,
        exitWarehouseCheck: null,
        exitWarehouseCustomer: null,
        exitWarehouseDriver: null,
        exitWarehouseVehicle: null,
        exitTransportMark: null,
        exitWarehousePerson: null,
        exitWarehouseTime: null,
        exitWarehouseConfirmPerson: null,
        exitWarehouseConfirmTime: null,
        adjustGoodsPerson: null,
        adjustGoodsTime: null,
        checkGoodsStatus: null,
        checkGoodsPerson: null,
        checkGoodsTime: null,
        originGoodsRightCustomer: null,
        goodsRightCustomer: null,
        goodsTransferTimes: null,
        goodsTransferNumber: null,
        goodsTransferPerson: null,
        goodsTransferTime: null,
        goodsTransferAuditPerson: null,
        goodsTransferAuditTime: null,
        goodsTransferIds: null,
        indoorWarehousePrice: null,
        outdoorWarehousePrice: null,
        storageFee: null,
        freeStorage: null,
        overduePriceMode: null,
        overduePrice: null,
        storageDay: null,
        overdueFee: null,
        stackTransferPrice: null,
        stackTransferFee: null,
        warehouseSettlementBillNumber: null,
        warehouseSettlementCustomer: null,
        goodsDamage: null,
        goodsDamagePicture: null,
        goodsRemark: null,
        distributeGoodsStatus: null,
        distributeGoodsCart: null,
        sendGoodsCustomer: null,
        endFlowDirection: null,
        endUnloadPoint: null,
        wayBillNumber: null,
        paymentMode: null,
        freightPriceMode: null,
        freightPrice: null,
        freightAmount: null,
        primage: null,
        freightTotalAmount: null,
        settlementMethod: null,
        settlementPriceMode: null,
        settlementPrice: null,
        settlementAmount: null,
        premiumFreight: null,
        settlementTotalAmount: null,
        freightPaymentBillNumber: null,
        freightSettlementBillNumber: null,
        otherNumber: null,
        threePartyNumber: null,
        parkCode: null,
        createBy: null,
        createTime: null,
      },
      // 表单参数
      form: {},
      // 字典项客户
      customerOptions: [],
      // 字典项始发流向
      beginFlowOptions: [],
      // 字典项目的流向
      endFlowOptions: [],
      // 字典项园区信息
      parkLocateOptions: [],
      // 字典项仓位信息
      warehouseLocateOptions: [],
      // 字典项区位信息
      regionLocateOptions: [],
      // 字典项货位信息
      goodsLocateOptions: [],
      // 货物重量合计
      goodsWeightSumList: [],
      // 下载客户名
      downloadCustomerName: null,
      // 显示货物ID
      showId: false,
      //选中货物总重量
      selectedGoodsSum: 0,
      // 表单校验
      rules: {
        bundleNumber: [
          { required: true, message: "捆包号不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
    this.getOption();
//    console.log('goods created @@@@');
//    console.log('this.dicts',this.dicts);
//    console.log('this.dict',this.dict);
//    console.log('this.customerOptions',this.customerOptions);
  },
  mounted() {
    this.$nextTick(() =>{
      // 根据浏览器高度设置初始高度 - 按钮行高度28 - 页码行高度28 - （面包屑+TAB行）高度160
      this.queryHeight = this.$refs.queryForm.$el.offsetHeight;
      this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 28 - 28 - 160;
      // 监听浏览器高度变化，改变表格高度
      window.onresize = () =>{
        this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 28 - 28 - 160;
      }
    })
  },
  methods: {
    /** 查询货物信息列表 */
    getList() {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeProduceDate && '' != this.daterangeProduceDate) {
        this.queryParams.params["beginProduceDate"] = this.daterangeProduceDate[0];
        this.queryParams.params["endProduceDate"] = this.daterangeProduceDate[1];
      }
      if (null != this.daterangeEnterWarehouseTime && '' != this.daterangeEnterWarehouseTime) {
        this.queryParams.params["beginEnterWarehouseTime"] = this.daterangeEnterWarehouseTime[0];
        this.queryParams.params["endEnterWarehouseTime"] = this.daterangeEnterWarehouseTime[1];
      }
      if (null != this.daterangeEnterWarehouseConfirmTime && '' != this.daterangeEnterWarehouseConfirmTime) {
        this.queryParams.params["beginEnterWarehouseConfirmTime"] = this.daterangeEnterWarehouseConfirmTime[0];
        this.queryParams.params["endEnterWarehouseConfirmTime"] = this.daterangeEnterWarehouseConfirmTime[1];
      }
      if (null != this.daterangeExitWarehouseTime && '' != this.daterangeExitWarehouseTime) {
        this.queryParams.params["beginExitWarehouseTime"] = this.daterangeExitWarehouseTime[0];
        this.queryParams.params["endExitWarehouseTime"] = this.daterangeExitWarehouseTime[1];
      }
      if (null != this.daterangeExitWarehouseConfirmTime && '' != this.daterangeExitWarehouseConfirmTime) {
        this.queryParams.params["beginExitWarehouseConfirmTime"] = this.daterangeExitWarehouseConfirmTime[0];
        this.queryParams.params["endExitWarehouseConfirmTime"] = this.daterangeExitWarehouseConfirmTime[1];
      }
      if (null != this.daterangeAdjustGoodsTime && '' != this.daterangeAdjustGoodsTime) {
        this.queryParams.params["beginAdjustGoodsTime"] = this.daterangeAdjustGoodsTime[0];
        this.queryParams.params["endAdjustGoodsTime"] = this.daterangeAdjustGoodsTime[1];
      }
      if (null != this.daterangeCheckGoodsTime && '' != this.daterangeCheckGoodsTime) {
        this.queryParams.params["beginCheckGoodsTime"] = this.daterangeCheckGoodsTime[0];
        this.queryParams.params["endCheckGoodsTime"] = this.daterangeCheckGoodsTime[1];
      }
      if (null != this.daterangeGoodsTransferTime && '' != this.daterangeGoodsTransferTime) {
        this.queryParams.params["beginGoodsTransferTime"] = this.daterangeGoodsTransferTime[0];
        this.queryParams.params["endGoodsTransferTime"] = this.daterangeGoodsTransferTime[1];
      }
      if (null != this.daterangeGoodsTransferAuditTime && '' != this.daterangeGoodsTransferAuditTime) {
        this.queryParams.params["beginGoodsTransferAuditTime"] = this.daterangeGoodsTransferAuditTime[0];
        this.queryParams.params["endGoodsTransferAuditTime"] = this.daterangeGoodsTransferAuditTime[1];
      }
      if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
        this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
        this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
      }

      if(isNotNull(this.queryParams.bundleNumber) && this.queryParams.bundleNumber.includes(','))
      {
        //console.log('includes , ');
        listGood(this.queryParams).then(response => {
        this.goodList = response.rows;
        this.total = response.total;
        this.loading = false;
        });
      } else {
        //console.log('not includes , ');
        listGoodExt(this.queryParams).then(response => {
        this.goodList = response.rows;
        this.total = response.total;
        this.loading = false;
        });
      }
      this.handleGoodsWeighSum();
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        goodsId: null,
        bundleNumber: null,
        goodsType: null,
        product: null,
        specification: null,
        steelGrade: null,
        weightMode: null,
        weight: null,
        poundWeight: null,
        theoryWeight: null,
        grossWeight: null,
        tareWeight: null,
        netWeight: null,
        deductWeight: null,
        numberOfPiece: null,
        agreementNumber: null,
        contractNumber: null,
        produceDate: null,
        trimEdge: null,
        recordSource: null,
        inventoryStatus: null,
        warehouseType: null,
        logisticsParkName: null,
        warehouseLocateName: null,
        regionLocateName: null,
        goodsLocateName: null,
        layerLocateName: null,
        warehouseTotalLocate: null,
        enterWarehouseNumber: null,
        enterWarehouseCheck: null,
        enterWarehouseCustomer: null,
        enterWarehouseDriver: null,
        enterWarehouseVehicle: null,
        enterTransportMark: null,
        enterWarehousePerson: null,
        enterWarehouseTime: null,
        enterWarehouseConfirmPerson: null,
        enterWarehouseConfirmTime: null,
        exitWarehouseNumber: null,
        exitWarehouseCheck: null,
        exitWarehouseCustomer: null,
        exitWarehouseDriver: null,
        exitWarehouseVehicle: null,
        exitTransportMark: null,
        exitWarehousePerson: null,
        exitWarehouseTime: null,
        exitWarehouseConfirmPerson: null,
        exitWarehouseConfirmTime: null,
        adjustGoodsPerson: null,
        adjustGoodsTime: null,
        checkGoodsStatus: null,
        checkGoodsPerson: null,
        checkGoodsTime: null,
        originGoodsRightCustomer: null,
        goodsRightCustomer: null,
        goodsTransferTimes: null,
        goodsTransferNumber: null,
        goodsTransferPerson: null,
        goodsTransferTime: null,
        goodsTransferAuditPerson: null,
        goodsTransferAuditTime: null,
        goodsTransferIds: null,
        indoorWarehousePrice: null,
        outdoorWarehousePrice: null,
        storageFee: null,
        freeStorage: null,
        overduePriceMode: null,
        overduePrice: null,
        storageDay: null,
        overdueFee: null,
        stackTransferPrice: null,
        stackTransferFee: null,
        warehouseSettlementBillNumber: null,
        warehouseSettlementCustomer: null,
        goodsDamage: null,
        goodsDamagePicture: null,
        goodsRemark: null,
        distributeGoodsStatus: null,
        distributeGoodsCart: null,
        sendGoodsCustomer: null,
        endFlowDirection: null,
        endUnloadPoint: null,
        wayBillNumber: null,
        paymentMode: null,
        freightPriceMode: null,
        freightPrice: null,
        freightAmount: null,
        primage: null,
        freightTotalAmount: null,
        settlementMethod: null,
        settlementPriceMode: null,
        settlementPrice: null,
        settlementAmount: null,
        premiumFreight: null,
        settlementTotalAmount: null,
        freightPaymentBillNumber: null,
        freightSettlementBillNumber: null,
        otherNumber: null,
        threePartyNumber: null,
        dataRealm: null,
        parkCode: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      if(isNotNull(this.queryParams.bundleNumber)){
        this.queryParams.bundleNumber = this.queryParams.bundleNumber.replace(/\s+/g, ',');
      }

      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeProduceDate = [];
      this.daterangeEnterWarehouseTime = [];
      this.daterangeEnterWarehouseConfirmTime = [];
      this.daterangeExitWarehouseTime = [];
      this.daterangeExitWarehouseConfirmTime = [];
      this.daterangeAdjustGoodsTime = [];
      this.daterangeCheckGoodsTime = [];
      this.daterangeGoodsTransferTime = [];
      this.daterangeGoodsTransferAuditTime = [];
      this.daterangeCreateTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
      this.warehouseLocateOptions = {};
      this.regionLocateOptions = {};
      this.goodsLocateOptions = {};
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.goodsId)
      this.single = selection.length!==1
      this.multiple = !selection.length
      let totalWeight = 0.0;
      this.selectList = selection;
      selection.forEach((goodItem) => {
        totalWeight = totalWeight + goodItem.weight;
      });
      this.selectedGoodsSum = totalWeight.toFixed(3);
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加货物信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const goodsId = row.goodsId || this.ids
      getGood(goodsId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改货物信息";
        this.handleLoadOptions();
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.goodsId != null) {
            updateGood(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addGood(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const goodsIds = row.goodsId || this.ids;
      this.$modal.confirm('是否确认删除货物信息编号为"' + goodsIds + '"的数据项？').then(function() {
        return delGood(goodsIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      if(isNotNull(this.queryParams.enterWarehouseCustomer)){
        this.downloadCustomerName = this.queryParams.enterWarehouseCustomer;
      } else if(isNotNull(this.queryParams.exitWarehouseCustomer)) {
        this.downloadCustomerName = this.queryParams.exitWarehouseCustomer;
      } else if(isNotNull(this.queryParams.goodsRightCustomer)) {
        this.downloadCustomerName = this.queryParams.goodsRightCustomer;
      } else if(isNotNull(this.queryParams.contractNumber)) {
        this.downloadCustomerName = this.queryParams.contractNumber;
      } else {
        this.downloadCustomerName = '货物导出';
      }

      this.download('goods/good/export', {
        ...this.queryParams
      }, `${this.downloadCustomerName}_${this.parseTime(new Date(), '{y}{m}{d}_{h}{i}')}.xlsx`)
    },
    computeTableHeight(){
      if( this.showSearch==true ){
        this.tableHeight = window.innerHeight - this.queryHeight - 28 - 28 - 160;
      } else {
        this.tableHeight = window.innerHeight - 28 - 28 - 160;
      }
    },
    getOption() {
      /** 字典项客户*/
      listCustomerOption().then(response => {
        this.customerOptions = response.data;

//        console.log('this.customerOptions',this.customerOptions);
      });
      /** 字典项流向 */
      var compare = function (obj1, obj2) {
          var val1 = obj1.endFlowClickNumber;
          var val2 = obj2.endFlowClickNumber;
          if (val1 < val2) {
              return 1;
          } else if (val1 > val2) {
              return -1;
          } else {
              return 0;
          }            
      } 
      listFlowOption().then(response => {
        this.beginFlowOptions = JSON.parse(JSON.stringify(response.data));
        this.endFlowOptions = JSON.parse(JSON.stringify(response.data));
        this.endFlowOptions.sort(compare);
//        console.log('this.beginFlowOptions', this.beginFlowOptions);
//        console.log('this.endFlowOptions',this.endFlowOptions);
      });

      /** 字典项园区 */
      listLocateOption(0).then(response => {
        this.parkLocateOptions = response.data;

//        console.log('this.parkLocateOptions',this.parkLocateOptions);
      });
    },
    handleChangeLogisticsPark(value) {
//      console.log('handleChangeLogisticsPark', value);
//      console.log('this.$refs.optionRef.selected.value', this.$refs.optionRef.selected.value);
//      console.log('this.$refs.optionRef.selected.label', this.$refs.optionRef.selected.label);
//      console.log('this.$refs.optionRef.selected.key', this.$refs.optionRef.selected.key);
      let park = {};
      park = this.parkLocateOptions.find((item) => {
        return item.name === value; //筛选出匹配数据
      });
//      console.log('park', park);
//      this.form.logisticsParkName = value.name;
//      console.log('handleChangeLogisticsPark', label);
      /** 字典项仓库 */
      listLocateOption(park.locateId).then(response => {
        this.warehouseLocateOptions = response.data;
        this.regionLocateOptions = {};
        this.goodsLocateOptions = {};
        this.form.warehouseLocateName = '';
        this.form.regionLocateName = '';
        this.form.goodsLocateName = '';
        this.form.warehouseTotalLocate = '';
        this.form.warehouseType = '';
//        console.log('this.warehouseLocateOptions',this.warehouseLocateOptions);
      });
    },
    handleChangeWarehouseLocate(value) {
//      console.log('handleChangeWarehouse', value);
      let warehouse = {};
      warehouse = this.warehouseLocateOptions.find((item) => {
        return item.name === value; //筛选出匹配数据
      });
      this.$set(this.form, 'warehouseType', warehouse.warehouseType);
//      console.log('warehouse', warehouse);
      /** 字典项区位 */
      listLocateOption(warehouse.locateId).then(response => {
        this.regionLocateOptions = response.data;
        this.goodsLocateOptions = {};
        this.form.regionLocateName = '';
        this.form.goodsLocateName = '';
//        console.log('this.regionLocateOptions',this.regionLocateOptions);
      });
      this.handleChangeGoodsLocate();
    },
    handleChangeRegionLocate(value) {
//      console.log('handleChangeWarehouse', value);
      let region = {};
      region = this.regionLocateOptions.find((item) => {
        return item.name === value; //筛选出匹配数据
      });
//      console.log('region', region);
      /** 字典项货位 */
      listLocateOption(region.locateId).then(response => {
        this.goodsLocateOptions = response.data;
        this.form.goodsLocateName = '';

//        console.log('this.goodsLocateOptions',this.goodsLocateOptions);
      });
      this.handleChangeGoodsLocate();
    },
    handleChangeGoodsLocate(value) {
      this.form.warehouseTotalLocate = this.form.logisticsParkName + this.form.warehouseLocateName + this.form.regionLocateName + this.form.goodsLocateName;
    },
    //
    handleLoadOptions(){
//      if(this.form.logisticsParkName != ''){
      if(isNotNull(this.form.logisticsParkName)){
//        console.log("this.form.logisticsParkName = ", this.form.logisticsParkName);
        let park = {};
        park = this.parkLocateOptions.find((item) => {
          return item.name === this.form.logisticsParkName; //筛选出匹配数据
        });
        /** 字典项仓库 */
        listLocateOption(park.locateId).then(response => {
          this.warehouseLocateOptions = response.data;

          if (this.form.warehouseLocateName != '') {
//            console.log("this.form.warehouseLocateName = ", this.form.warehouseLocateName);
            let warehouse = {};
            warehouse = this.warehouseLocateOptions.find((item) => {
              return item.name === this.form.warehouseLocateName; //筛选出匹配数据
            });
            /** 字典项区位 */
            listLocateOption(warehouse.locateId).then(response => {
              this.regionLocateOptions = response.data;
              if (this.form.regionLocateName != '') {
//                console.log("this.form.regionLocateName = ", this.form.regionLocateName);
                let region = {};
                region = this.regionLocateOptions.find((item) => {
                  return item.name === this.form.regionLocateName; //筛选出匹配数据
                });
                /** 字典项货位 */
                listLocateOption(region.locateId).then(response => {
                  this.goodsLocateOptions = response.data;
                });
              }
            });
          }
        });
      }
    },
    handleGoodsWeighSum() {
//      console.log('handleGoodsWeighSum');
//      let inventoryStatus = ['入库中','已在库', '出库中', '已出库', '转货中'];
      let query = {
        bundleNumber: this.queryParams.bundleNumber,
        goodsType: this.queryParams.goodsType,
        agreementNumber: this.queryParams.agreementNumber,
        contractNumber: this.queryParams.contractNumber,
        inventoryStatus: this.queryParams.inventoryStatus,
        enterWarehouseCustomer: this.queryParams.enterWarehouseCustomer,
        exitTransportMark: this.queryParams.exitTransportMark,
        exitWarehouseCustomer: this.queryParams.exitWarehouseCustomer,
        goodsRightCustomer: this.queryParams.goodsRightCustomer, 
        params: {},
      };
//      query.params = {};
      if (null != this.daterangeEnterWarehouseTime && '' != this.daterangeEnterWarehouseTime) {
        query.params["beginEnterWarehouseTime"] = this.daterangeEnterWarehouseTime[0];
        query.params["endEnterWarehouseTime"] = this.daterangeEnterWarehouseTime[1];
      }
      if (null != this.daterangeExitWarehouseTime && '' != this.daterangeExitWarehouseTime) {
        query.params["beginExitWarehouseTime"] = this.daterangeExitWarehouseTime[0];
        query.params["endExitWarehouseTime"] = this.daterangeExitWarehouseTime[1];
      }

//      console.log('query', query);
      getGoodsWeightSum(query).then(response => {
        this.goodsWeightSumList = response.data;
//        console.log('response.data = ', response.data);
      });
    },
    // 切换显示货物ID
    handleShowId() {
      if (this.showId) {
        this.showId = false;
      } else {
        this.showId = true;
      }
      this.$nextTick(() =>{
        this.$refs.goodTable.doLayout();
      })
    }
  }
};
</script>
